<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>H+ 后台主题UI框架 - 空白页</title>
    <meta name="keywords" content="">
    <meta name="description" content="">

    <link rel="shortcut icon" href="favicon.ico">  <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.css?v=4.4.0" rel="stylesheet">
     <link href="__STATIC__/layout/css/plugins/summernote/summernote.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/summernote/summernote-bs3.css" rel="stylesheet">
     <link rel="stylesheet" type="text/css" href="__STATIC__/layout/css/plugins/webuploader/webuploader.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/layout/css/demo/webuploader-demo.css">
    <!-- jqgrid-->
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
        <style>
    .fujian{
      width:auto;
      margin:10px;
      border:1px solid #333;
      cursor:pointer;
      float:left;
    }
    </style>
</head>

<body style="color:#333;padding:3px;" class="x_sorll">
    <!-- 标题 -->
    <div class="page-heade">
      <h2 class="title_color text-center">补发票申请-查看 </h2>
    </div>
    <!-- 标题 -->
   <form id="f1" class="form-inline">
   <input type="hidden" name="state" id="state"/>
   <input type="hidden" name="pfid" value="{$main.id}"/>
     <table class="table table-bordered text-center bud_hei" style="margin-bottom: 0">
       
        <tr>
            <td style="min-width: 120px;width: 120px">申请人</td>
            <td class="text-left">{$main.em_name}</td>
            <td style="min-width: 120px;width: 120px">所属部门/职位</td>
            <td class="text-left" style="min-width: 200px;width: 200px">{$main.de_name}/{$main.job_name}</td>
            <td style="min-width: 120px;width: 120px">提交时间</td>
            <td class="text-left" style="min-width: 200px;width: 200px">{$main.ctime}</td>
            
        </tr>
         <tr>
            <td style="min-width: 120px;width: 120px">流程编号</td>
            <td class="text-left" >{$main.no}</td>
            <td style="min-width: 120px;width: 120px">经销商名称</td>
           
            <td class="text-left" colspan="3">{$main.jxs}</td>
        </tr>
        <tr>
          <td colspan="6" class="text-left" style="color:red;">温馨提示：请在发票粘帖联上注明此申请单号:{$main.no}<a>点此查看图列</a>,如邮寄地址未显示，请联系相关人员进行邮寄地址添加</td>
        </tr>
    </table>
      <table class="table table-striped table-bordered text-center bud_hei">
        <tr class="info text-center">
            <th class="text-center" rowspan="2">序号</th>
           <th class="text-center" rowspan="2">明细编号</th>
            <th class="text-center" rowspan="2">核销明细编号</th>
            <th class="text-center" rowspan="2">原活动明细编号</th>
            <th class="text-center" rowspan="2">核销申请人</th>
            <th class="text-center" rowspan="2">收款方</th>
            <th class="text-center" rowspan="2">三级费用科目</th>
            <th class="text-center" rowspan="2">是否增值税</th>
            <th class="text-center" rowspan="2">税率</th>
              <th class="text-center" colspan="3">支付信息</th>
               <th class="text-center" rowspan="2">发票号</th>
          </tr>
          <tr class="info text-center">
               <th class="text-center" >未税金额</th>
            <th class="text-center" >税金</th>
            <th class="text-center" >含税金额</th>
           </tr>
           
        {volist name="apply" id="vo"}
            <tr class="neirong">
                <td>{$i}</td>
                <td>{$vo.no}_{$vo.detail_no}</td>
                  <td><a onclick="hx({$vo.heid})">{$vo.hexiao_no}_{$vo.hexiao_detail_no}</a></td>
             {if $vo.type_id==2}
             <td><a onclick="cg({$vo.apid})">{$vo.apply_no}_{$vo.apply_detail_no}</a></td>
             {elseif $vo.type_id==1/}
            <td><a onclick="jc({$vo.apid})">{$vo.apply_no}_{$vo.apply_detail_no}</a></td>
              {else/}
              <td><a onclick="fcg({$vo.apid})">{$vo.apply_no}_{$vo.apply_detail_no}</a></td>
              {/if}
              <td>{$vo.em_name}</td>
                {if $vo.payee}
             <td>(供货商){$vo.gys_name}</td>
             {else/}
             <td>(经销商){$vo.jxs_name}</td>
             {/if}
              <td>{$vo.kemu}</td>
               <td>{if $vo.dikou==1}是{else/}否{/if}</td>
              <td><span class="num2 ObjectNum">{$vo.shuilv}</span>%</td>
              <td class="num2 ObjectNum">{$vo.weishuihexiaojine}</td> <td class="num2 ObjectNum">{$vo.shuijin}</td><td class="num2 ObjectNum">{$vo.hanshuihexiaojine}</td>
             <td>{$vo.fp_no}</td>
            </tr>
        {/volist}
           
     <tr>
            <td colspan="2" >备注：</td>
            <td colspan="11" class="text-left">
               {$main.remark}
            </td>
          </tr>
        </table>
         <table class="table table-bordered text-left bud_hei">
            <tr class="info">
                <th class="text-left font-bold">审批意见</th>
            </tr>
            {volist name="logs" id="l"}
          <tr>
              <td>{$l.USERNAME} 审批动作：{$l.MEMO}；审批意见：{if $l.COMMENTS}{$l.COMMENTS}{else/}无{/if}(审批时间：{$l.ACTIONTIME})</td>
          </tr>
          
          {/volist}
      </table>


         {if $fujian}
       附件:
          <div>
            {volist name="fujian" id="fu"}
              <div class="fujian" onclick="down({$fu.id})">{$fu.file_name}</div>
            {/volist}
          </div>
       {/if}
        <div class="row padding-10 text-center">
           
             
             <button class="btn btn-primary" type="button" id="bcnext">进入下一步</button>
             
        </div>
     </form>
     <div class="footer fixed_full text-center" id="fixBG">
        本次补发票未税金额合计：<strong class="colorRed"><span id="allweishui" class="num2 ObjectNum">0.00</span>元</strong>;税金合计：<strong class="colorRed"><span id="allshuijin" class="num2 ObjectNum">0.00</span>元</strong>;含税金额合计：<strong class="colorRed"><span id="allhanshui" class="num2 ObjectNum">0.00</span>元</strong>;实际金额合计：<strong class="colorRed"><span id="allhanshui2" class="num2 ObjectNum">0.00</span>元</strong>;
    </div>
    {if $main.state==7}
    <div class="applyImg font-bold">
        申报已生效
      </div>
      {/if}
     </form>
    <!-- 全局js -->
    <script src="__STATIC__/layout/js/jquery.min.js?v=2.1.4"></script>
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
    <script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
      <script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
              <script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>
                 <script src="__STATIC__/layout/js/common.js"></script>
                  <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
   <script>
   $("#bcnext").click(function(){
            
                     location.href='{:url("Workflowdb/gzlsp",["workId"=>request()->param("workId"),"trackId"=>request()->param("trackId")])}'
            
        })
    function hx(aid){
     var index = layer.open({
                            type:2,
                            title:'常规促销申请',
                            area:['100%','100%'],
                            maxmin:true,
                            content:'{:url("Tihexiao/view")}?id='+aid
                        })
}
    function cg(aid){
     var index = layer.open({
                            type:2,
                            title:'常规促销申请',
                            area:['100%','100%'],
                            maxmin:true,
                            content:'{:url("Ti_apply/apply_de")}?aid='+aid
                        })
}
 function fcg(aid){
     var index = layer.open({
                            type:2,
                            title:'非常规促销申请',
                            area:['100%','100%'],
                            maxmin:true,
                            content:'{:url("Ti_apply2/view")}?id='+aid
                        })
}
function jc(aid){
  var index = layer.open({
                            type:2,
                            title:'Ti进场费用申请',
                            area:['100%','100%'],
                            maxmin:true,
                            content:'{:url("Tijinchang/view")}?id='+aid
                        })
}
 function jisuan(){
      var weishui=0;var shuijin=0;var hanshui=0;
      $(".neirong").each(function(){
        
          weishui+=parseFloat($(this).children().eq(9).html().replace(',', ''));
          shuijin+=parseFloat($(this).children().eq(10).html().replace(',', ''));
          hanshui+=parseFloat($(this).children().eq(11).html().replace(',', ''));
         // alert(hanshui);
        
      })
      $("#allweishui").html(weishui.toFixed(2));$("#allshuijin").html(shuijin.toFixed(2));$("#allhanshui").html(hanshui.toFixed(2));$("#allhanshui2").html(hanshui.toFixed(2));
         var $ObjectNum =$(".ObjectNum");
               toNum($ObjectNum);
    }
   
function down(id){
  location.href="{:url('download_fujian')}?fid="+id;
}
    function back(){
      location.href="{:url('index2')}";
    }
              //详情也

    $(function(){
       jisuan();
                $(".num2").each(function(){
        $(this).html(parseFloat($(this).html()).toFixed(2));
     })
         
         var $ObjectNum =$(".ObjectNum");
               toNum($ObjectNum);
      
    })
   </script>
  
</body>

</html>
